State machine
The system is always persisting in one of its allowed states. These states are also called modes and are visible as a state variable inside the system as a number. An important fact about the state machine is that it gives the order to all the modes - the lower the number is, the higher the priority is. This will ensure that the behavior is always defined (i.e., throttle and brake applied simultaneously).
LYNX modes description
The mode is a state of the LYNX application. It is the output of the state machine. The mode is useful for the user to know what is the controller doing during debugging.
The mode is variable /mode
in the root. Also it is sent periodically over CAN in message 0x600 - LYNX status.
MODE name | MODE number | Description |
---|---|---|
MODE_STOP | 0 | Driver or common block is in error. Check /driver/error and /common/error . |
MODE_INVALID_INPUTS | 2 | Controler GPIO reading is not valid. Check /common/state . |
MODE_BMS_ERROR | 6 | There is timeout for communication with the BMS. |
MODE_IDENT | 9 | Motor identification is in process. |
MODE_INIT | 10 | LYNX is initializing. This equals to /best/reset_time |
MODE_CAN_TIMEOUT | 20 | Timeout for CAN 0x5FF - Controll input message (if used). Timeout is 200ms |
MODE_WELDING | 30 | Controller is used as MMA welder. Only in FW VECTOR_LYNX_welding. |
MODE_CHARGE_EXT_FOREVER | 65 | BMS reports charging. Ride is disabled until next powercycle. |
MODE_CHARGE_EXT | 68 | BMS report charging. Ride will be allowed after the BMS stop reporting charging. |
MODE_CHARGE | 70 | Controller act as step-up converter and charging battery. (Not present in standard HW) |
MODE_SLAVE | 79 | Device is under the control from the Master controller - Multi controller setup. |
MODE_OVR | 80 | Driver is overriden by Driver API or using term. |
MODE_LOCK | 90 | Device is locked |
MODE_STANDBY | 100 | Device is ready, motor is freewheeling, no throttle, brake, etc. |
MODE_BRAKE | 101 | Device is braking |
MODE_ACCELERATE | 102 | Device is accelerating from the throttle |
MODE_KICKBACK | 104 | Kickback assist active |
MODE_ASSIST | 105 | Device is accelerating from PAS |
MODE_CRUISE | 110 | Device is accelerating due to cruise function |
MODE_DISARMED_FOREVER | 120 | LYNX disarmed forever - throttle input is disabled |